<template>
  <div class="carousel">
    <el-carousel trigger="click" autoplay>
      <el-carousel-item v-for="item in 4" :key="item">
        <img src="https://tu.ltyuanfang.cn/api/fengjing.php?_r=132" alt="" />
        <h3>标题</h3>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
  export default {
    name: 'carrousel',
    data() {
      return {};
    },
  };
</script>
<style lang="less" scoped>
  .carousel {
    width: 100%;
    max-height: 20.8333vw;
    min-height: 220px;
  }
  .el-carousel {
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 18px;
  }
  .el-carousel__item {
    position: relative;
    width: 100%;
    height: 100% !important;
  }
  .el-carousel__container {
    width: 100%;
    height: 100% !important;
  }
  .el-carousel__item img {
    display: block;
    width: 100%;
    height: 100% !important;
  }
  .el-carousel__item h3 {
    position: absolute;
    height: 38px;
    left: 50%;
    bottom: 10px;
    color: #fff;
    transform: translate(0px, -50%);
    -webkit-transform: translate(0px, -50%);
    -moz-transform: translate(0px, -50%);
    -ms-transform: translate(0px, -50%);
    -o-transform: translate(0px, -50%);
  }
</style>
